home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 14 / Mac Magazin and MacEasy Magazine CD - Issue 14.iso / Wissenschaft & Technik / Tools Plus 2.6.1 Evaluation Kit / Tools Plus 2.6.1 / Tutorials / 3-List Boxes / About… List Boxes next >
INI File  |  1995-08-01  |  3KB  |  54 lines

  1. [Display in Geneva 12pt]
  2.  
  3.  
  4.  
  5. List Boxes
  6. ~~~~~~~~
  7. This tutorial focuses primarily on list boxes. Creating and maintaining a list box is pretty straight-forward, so a few “less obvious” things are demonstrated in this tutorial. In this tutorial, you will:
  8.    • create list boxes using different fonts
  9.    • create list boxes that are a _perfect_ height
  10.    • populate a list box with the names of the fonts on your Mac
  11.    • move lines between lists
  12.    • insert lines in alphabetic order
  13.    • delete lines from a list
  14.  
  15. We have also move the “response to an event” code out of the main event loop. You may want to do the same in your application when you notice that there is a fair amount of code dedicated to event processing.
  16.  
  17. In applications that have multiple windows, you may want to create a separate routine dedicated to responding to events for a single window. It’s all up to your own preferences and coding style.
  18.  
  19.  
  20.  
  21.  
  22. Additional Events
  23. ~~~~~~~~~~~~~~
  24. Your application will now respond to doListBox events. When the user clicks in a list box, Tools Plus generates a doListBox event. Your application can either respond to the event and do something right away (like in this tutorial), or do nothing until a Done or Cancel button is clicked (as you would see in many dialogs).
  25.  
  26.  
  27.  
  28.  
  29. Some Cheating
  30. ~~~~~~~~~~~
  31. To minimize this tutorial, we removed the pull-down menus (and made sure that they were not needed by using a modal window). We also reduced the event loop to account for only the doButton and doListBox events because we don’t need anything else.
  32.  
  33.  
  34.  
  35.  
  36. List Manager Limits
  37. ~~~~~~~~~~~~~~~~
  38. Tools Plus inherits the toolbox List Manager’s limitations in two areas:
  39.    • a list can contain a maximum of 32000 empty lines
  40.    • a list can contain no more than 32K of data
  41. These limits were imposed in the early days of Macintosh when a really big computer had 640K of RAM, so 32K for a single list seemed ample at the time.
  42.  
  43. Realize that these limits are built right into Macintosh’s toolbox, and they are not limits imposed by Tools Plus alone.
  44.  
  45. If you need to break the 32K data limit, you have several options at your disposal:
  46.   (1) Write your own list management routines (and take care of
  47.         displaying, scrolling, and selecting)
  48.   (2) Get a third-party list manager, such as StoneTablet
  49.         Publishing’s “StoneTable” (Internet: stack@teleport.com or 
  50.         phone: (503) 287-3424). It takes more work than Tools Plus
  51.         to get it working, but it breaks the 32K data barrier.
  52.   (3) Wait for a future release of Tools Plus in which we will
  53.         rewrite the list manager
  54.